
var api = require('../../utils/api.js');
var app = getApp();
Page({
    data: {
        tophe:0,
        desc:''
    },
    currentPageNumber: 1,
        onLoad() {
        var file=api.FIlE;
        this.setData({
            bg:file
        })
       
    },
    onShow() {
        let jn = wx.getMenuButtonBoundingClientRect();

        console.log(jn);
        var tophe=jn.top+jn.height+15;
        this.setData({
            tophe:tophe+'px',
            over:jn.top
        })
     
    },
    back(){
        wx.switchTab({
          url: '/pages/index/index',
        })
    },

    getdesc(ret){
        this.setData({
            desc:ret.detail.value
        })
    },
    
    fabus(){

        var desc=this.data.desc;
        var that=this;

        wx.showLoading({
          title: '发送中',
        })

        api.post({
            url: 'message/submit',
            data: {desc:desc},
            success: data => {
                wx.showToast({
                  title: data.msg,
                  icon:'none'
                })
                setTimeout(() => {
                    wx.switchTab({
                        url: '/pages/index/index',
                      })
                }, 1000);

            },
        });

    }

});
